package model

import (
	"time"
)

const DefineUnitName = "define_unit"

type DefineUnit struct {
	Id       int               `json:"id" orm:"auto" sql:"INT"`
	Key      string            `json:"key" sql:"VARCHAR"`
	Type     byte              `json:"type" sql:"TINYINT"`
	Name     map[string]string `json:"name" sql:"JSON"`
	Desc     map[string]string `json:"desc" sql:"JSON"`
	Category string            `json:"category" sql:"VARCHAR"`

	Level int `json:"level" sql:"TINYINT"`

	CanCreate     bool                     `json:"can_create" sql:"TINYINT"`
	FilterRequire CompareDataRelationSlice `json:"filter_require" sql:"JSON"`

	Range           []int  `json:"range" sql:"JSON"`
	OrderMode       int    `json:"order_mode" sql:"INT"`
	TargetMode      int    `json:"target_mode" sql:"INT"`
	SelfMask        []uint `json:"self_mask" sql:"JSON"`
	OtherMask       []uint `json:"other_mask" sql:"JSON"`
	OtherAutoMask   []uint `json:"other_auto_mask" sql:"JSON"`
	AttackRangeMask []uint `json:"attack_range_mask" sql:"JSON"`
	AttackRouteMask []uint `json:"attack_route_mask" sql:"JSON"`
	CanDestroy      bool   `json:"can_destroy" sql:"TINYINT"`
	CanAi           bool   `json:"can_ai" sql:"TINYINT"`
	DestroyItem     int    `json:"destroy_item" sql:"INT"`
	UnitNumber      int    `json:"unit_number" sql:"JSON"`

	SyncKeys []string `json:"sync_keys" sql:"JSON"`

	UpdateTime *time.Time `json:"update_time" orm:"updateTime" sql:"DATETIME"`
}
